import service from '@/utils/request'

const BusinessServerApi = {
  listBusinessServer:function(data){
    return service.get('businessServer/page', { params:data})
  },
  listByParam:function(data){
    return service.get('businessServer/listByParam', {params:data})
  },
  addBusinessServer:function(data){
      return service.post('businessServer', data)
  },
  editBusinessServer:function(data){
      return service.put('businessServer', data)
  },
  updateBusinessServer:function(data){
    return service.put('businessServer/updateBusinessServer', data)
  },
  deleteBusinessServer:function(data){
      return service.put('businessServer/delete', data)
  },
  getBusinessServerInfo(data){
    return service.get('businessServer', {params:data})
  },
  getBusinessServerList(data){
    return service.get('businessServer/listIdName', {params:data})
  },
  getMultipleBusinessServer(data){
    return service.get('businessServer/listServer', {params:data})
  },
  getDistributionInfo(data){
    return service.get('businessVillage/idNameMap', {params:data})
  },
  setDistribution(data){
    return service.put("businessServer/distribution",data)
  },
  // businessServer/batchCopyToBS
  batchCopyToBS(data){
    return service.put("businessServer/batchCopyToBS",data)
  },
  batchAddGoods(data){
    return service.post("businessServer/batchAddData",data)
  },
  batchDelete(data){
    return service.put("businessServer/batchDelete",data)
  },
  copyServer(data){
    return service.post("businessServer/serverCopyToBS",data)
  },
  batchSetDepart(data){
    return service.put("businessServer/batchSetDepart",data)
  },
  setStock(data){
    return service.put("businessServer/batchSetStock",data)
  },
  listVariantInfo(data){
    return service.get("businessServer/listVariantInfo",{params:data})
  },
  setMoreVariantStock(data){
    return service.put("businessServer/setMoreVariantStock",data)
  },
  addCombo:function(data){
    return service.post('businessServer/addCombo', data)
  },
  businessServerTree:function(data){
    return service.get('businessServer/idNameTree', {params:data})
  },
  setRelation:function(data){
    return service.post('businessClassifyServer/setRelation', data)
  },
  batchSetRelation:function(data){
    return service.post('businessClassifyServer/batchSetRelation', data)
  },
  classifyListIdName:function(data){
    return service.get('businessClassify/listIdName', {params:data})
  },
  listByServer:function(data){
    return service.get('businessServerRelation/listByServer', {params:data})
  },
  bandRelation:function(data){
    return service.put('businessServerRelation/bandRelation', data)
  },
  batchSetByType(data){
    return service.put("businessServer/batchSetByType",data)
  },
  batchSetMultiVariant(data){
    return service.post("businessServer/batchSetMultiVariant ",data)
  },
  // 通过产品获取变体
  listServerVariant(data){
    return service.get('businessServer/listServerVariant', {params:data})
  },
  businessServerCopy(data){
    return service.post('businessServer/businessServerCopy', data)
  },
  exportSetInfo(data){
    return service.get("businessServer/exportSet",{params:data,responseType: "blob"})
  },
  updateImportSetInfo(data){
    return service.get("businessServer/updateImportSet",{params:data})
  },
  importMainImage(data){
    return service.get("businessServer/updateImportMainImage",{params:data})
  }
}

export default BusinessServerApi
